<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <include file="Common:header_include"/>
    <title>健康档案</title>
    <style>
        .nav-tabs{
            border-bottom: 1px solid #2896F2;
        }
        #hylx, #chakan {
            width: 800px;
            height: 500px;
            border: 1px solid rgba(0, 0, 0, .2);
            border-radius: 6px;
            box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
        }
        .archives tbody tr:first-child td:first-child a{
            display:inline-block;
            width: 100px;
            height:100px;
            border:1px solid #ddd;
            border-radius: 50%;
            overflow: hidden;
            margin-top:57px;
        }
        .archives tbody tr:first-child td:first-child a img{
            width:100px;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">欢迎来到易术网！</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="{:U('Logout')}">退出</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown"><img src="__HIMG__photo.png" alt="" style="width: 25px;margin-top: 11px"/></li>
                <li class="dropdown"><a href="{:U('Doctor/info')}">个人中心</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li class="NEW"><a class="headerBox" href="javascript:;">消息<b>3</b></a>
                    <div class="show_text">
                        <a href="" >sdfsdf</a>
                        <a href="" >sdfsdf</a>
                        <a href="" >sdfsdf</a>
                        <a href="" >sdfsdf</a>
                        <a href="" >sdfsdf</a>

                    </div>
                </li>
                <!--可添加消息-->
            </ul>
        </div>
    </div>
</nav>
<!--LOGO-->
<div class="header_cont">
    <a href="javascript:;">
        <span class="logo"></span><img src="__HIMG__text.png" alt=""/>
    </a>
</div>
<ol class="breadcrumb ">
    <li><span class="glyphicon glyphicon-home"></span> <a href="{:U('Index/index')}">首页</a></li>
    <li class="active">“{$info[patient]['true_name']}”健康档案</li>
</ol>
<!--头部结束-->
<!--主体开始-->
<div class="container">
    <!--患者信息开始-->
        <table class="table  table-bordered text-center archives">
            <tr>
                <td class="white" rowspan="6">
                    <a href="javscript:;">
                        <if condition="empty($info[patient]['cover'])">
                            <img src="__HIMG__photo.png" alt="">
                            <else/>
                            <img src="__UPS__{$info[patient]['cover']}" alt="">
                        </if>
                    </a>


                </td>
                <td  class="info">姓名</td>
                <td class="white">{$info[patient]['true_name']}</td>
                <td  class="info">昵称</td>
                <td class="white">{$info[patient]['nick']}</td>
                <td  class="info">性别</td>
                <td class="white">
                    <if condition="$info[patient]['gender'] eq 0"> 女</if>
                    <if condition="$info[patient]['gender'] eq 1"> 男</if>
                </td>
            </tr>
            <tr>
                <td  class="info">年龄</td>
                <td class="white">{$info[patient]['age']}</td>
                <td  class="info">血型</td>
                <td class="white">
                    <if condition="$info[patient]['blood_id'] eq 1"> A型</if>
                    <if condition="$info[patient]['blood_id'] eq 2"> B型</if>
                    <if condition="$info[patient]['blood_id'] eq 3"> AB型</if>
                    <if condition="$info[patient]['blood_id'] eq 4"> 0型</if>
                    <if condition="$info[patient]['blood_id'] eq 5"> Rh阴性血</if>

                </td>
                <td  class="info">出生日期</td>
                <td class="white">{:date('Y-m-d',$info[patient]['birthday'])}</td>
            </tr>
            <tr>
                <td  class="info">联系方式</td>
                <td class="white">{$info[patient]['phone']}</td>
                <td  class="info">紧急联系方式</td>
                <td class="white">{$info[patient]['emergency_phone']}</td>
                <td  class="info">身高</td>
                <td class="white">{$info[patient]['height']}cm</td>
            </tr>
            <tr>
                <td  class="info">体重</td>
                <td class="white">{$info[patient]['weight']}kg</td>
                <td  class="info">身份证</td>
                <td class="white">{$info[patient]['id_card']}</td>
                <td  class="info">邮箱</td>
                <td class="white">{$info[patient]['email']}</td>

            </tr>
            <tr>
                <td class="info">家庭住址</td>
                <td class="white" colspan="5">{$info[patient]['address']}</td>
            </tr>
            <tr>
                <td class="info">初步诊断</td>
                <td class="white" colspan="5">{$info['remark']}</td>
            </tr>
        </table>
    <?php
      if(empty($info['helper_id'])){
        $info['helper_id']=0;
          }
    ?>
        <p class="text-center mt">
            <a   onclick="Byval({$info[patient]['id']},{$info['helper_id']})"  class="btn btn-warning" data-toggle="modal" data-target=".myModal" >分配</a>
           <if condition="I('status_id') eq 1">
               <a   href="{:U('editstatus',array('patient_id'=>$info[patient]['id'],'type'=>1))}"  class="btn btn-success">同意</a>
               <a   href="{:U('editstatus',array('patient_id'=>$info[patient]['id'],'type'=>0))}"   class="btn btn-info">拒绝</a>
               <elseif condition=" I('status_id') eq 2"/>
                <button type="button" class="btn btn-success">交流</button>
                <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
                <button type="button" class="btn btn-danger">诊断</button>
                  <elseif condition="I('status_id') eq 2"/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
	            <button type="button" class="btn btn-danger">诊断</button>
	            <elseif condition="I('status_id')  eq 4"/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
	            <button type="button" class="btn btn-danger">约谈</button>
	            <elseif condition="I('status_id')  eq 5"/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
	            <button type="button" class="btn btn-danger">术前</button>
	            <elseif condition="I('status_id') eq 6"/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
	            <button type="button" class="btn btn-danger">术后</button>
	            <elseif condition="I('status_id')  eq 7"/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">手术追踪</button>
	            <button type="button" class="btn btn-danger">出院</button>
	            <else/>
	            <button type="button" class="btn btn-success">交流</button>
	            <button type="button" class="btn btn-info" onclick="javascript:top.location='shoushuzhuizong.html';" value="_black">术后随访</button>
           </if>
        </p>

    <!-- 
    分配助手列表
     -->
  <div class="modal fade myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title text-left" id="myModalLabel">权限分配</h4>
                </div>
                <div class="modal-body">
                    <!--搜索助手开始-->
                    <!--搜索助手结束-->
                    <div class="clear">
                        <table class="table table-hover table-bordered text-center helper-list" id="text_helper">
                            <thead>
                            <tr style="background: #f8f8f8" class=" helper-name" id="helpername">
                                <th><b>姓名</b></th>
                                <th><b>科室</b></th>
                                <th><b>主治疾病</b></th>
                                <th><b>联系方式</b></th>
                                <th><b>操作</b></th>
                            </tr>
                            </thead>
                                <volist name=":GethelperList()" id="k">
                                    <tr class="text-center" style="vertical-align:middle">
                                        <input  type="text" value="" style="display: none" id="patient_id">
                                       <!--  <input  type="text" value="" style="display: none" id="helper_id"> -->
                                        <td >{$k['true_name']}</td>
                                        <td >{$k[department]['title']}</td>
                                        <td >{:ArrayTo($k['disease_id'])}</td>
                                        <td>{$k['phone']}</td>
                                        <td>
                                            <a id="alloc{$k['id']}" data-toggle="modal" onclick="allocation({$k['id']})" class="btn-success btn-xs">
                                                分配
                                            </a>
                                        </td>
                                    </tr>
                              </volist>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div style="height: 8px">

    </div>
    <!-- 结束 -->
    <!--健康档案列表开始-->
    <?php
                if($_GET['recordclass']==""){
                  $_GET['recordclass']=1;
                }
                ?>
    <ul class="nav nav-tabs" role="tablist" id="myTab">
        <volist name=":GetRecordClass()" id="k"  empty="暂时没有数据">
            <li role="presentation" <if condition="$k['id'] eq $_GET['recordclass'] "> class="active"</if> >
            <a href="?recordclass={$k['id']}" >{$k.title}</a>
            </li>
        </volist>
    </ul>
        <if condition="$_GET['recordclass'] eq 1">
            <!--病历-->
            <volist name=":GetHealthRecordData($_GET['recordclass'],$info[patient]['id'])" id="v">
                <div role="tabpanel" class="tab-pane active gallery"  >
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <div class="collapsed" data-toggle="collapse" data-parent="#accordion"
                                     aria-expanded="false" aria-controls="collapseTwo">
                                    <b>{$v[hospital]['title']}</b>
                                    <span style="float: right">{:date('Y-m-d',$v['create_time'])}</span>
                                </div>
                            </h4>
                        </div>
                        <div role="tabpanel">
                            <div class="panel-body">
                                <p>
                                    {$v['content']}
                                </p>
                                   <volist name="v[record_picture]" id="k" empty="暂时没有数据">
                                   <a href="javascript:;" class="portrait">
                                    <img class="pic" src="__UPS__{$k['cover']}"data-src-wide="__UPS__{$k['cover']}"alt="BINGOO"/>
                                   </a>
                                   </volist>
                            </div>
                        </div>
                    </div>
                </div>
              </volist>
            <elseif condition="$_GET['recordclass'] eq 2"/>
            <!--检查记录-->
            <div role="tabpanel" class="tab-pane" id="two">
                <p class="text-right"  style="padding:10px 0;">
                    <button type="button" class="btn btn-warning">添加化验类型</button>
                </p>
                <table class="table table-hover table-bordered text-center">
                    <thead>
                    <tr style="background: #F8F8F8">
                        <th class="text-center"><b>检测项目名</b></th>
                        <th class="text-center"><b>检测项目</b></th>
                        <th class="text-center"><b>日期</b></th>
                        <th class="text-center"><b>化验结果</b></th>
                        <th class="text-center"><b>操作</b></th>
                    </tr>
                    </thead>
                    <tbody>
                     <volist name=":GetHealthRecordData($_GET['recordclass'],$info[patient]['id'])" id="v">
                         <tr style="line-height: 37px">
                         <td class="text-center">{$v['title']}</td>
                         <td class="set"  style="border-right: 1px solid #dddddd">
                             {:GetContent($v['content'])}
                         </td>
                        <td style="border-right: 1px solid #dddddd">
                            {:date("Y-m-d H:i",  $v['last_time']) }
                        </td>
                        <td class="jieguo"  style="border-right: 1px solid #dddddd">
                            {:GetReviewed($v['content'])}
                        </td>
                       <td>
                           <a class="btn-xs btn-success" data-toggle="modal" href="javascript:;" onclick="chakan({$v['id']})">查看</a>
                       </td>
                        </tr>
                     </volist>
                    </tbody>
                </table>
                <div class="modal" id="hylxModal">
                    <div class="modal-dialog">
                        <iframe id="hylx" frameborder="0">
                        </iframe>
                    </div>
                </div>
                <!--查看化验结果-->
                <div class="modal" id="chakanModal">
                    <div class="modal-dialog">
                        <iframe id="chakan" frameborder="0">
                        </iframe>
                    </div>
                </div>
            </div>
            <elseif condition="$_GET['recordclass'] eq 3"/>
            <!--用药记录-->
                <div role="tabpanel" class="tab-pane" >
                    <!--第一条-->
                    <volist name=":GetHealthRecordData($_GET['recordclass'],$info[patient]['id'])" id="k">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <div class="collapsed" data-toggle="collapse" data-parent="#accordion"
                                         aria-expanded="false" aria-controls="collapseTwo">
                                        <b>{$k[hospital]['title']}</b><span style="float: right">{:date('Y-m-d',$k['create_time'])}</span>
                                    </div>
                                </h4>
                            </div>
                            <div role="tabpanel">
                              <div class="panel-body">
                                <p>
                                    {$k['content']}
                                </p>
                                <volist name="k[record_picture]" id="s" >
                                    <a href="javascript:;" class="portrait">
                                        <img class="pic" src="__UPS__{$s['cover']}"data-src-wide="__UPS__{$s['cover']}"alt="BINGOO"/>
                                    </a>
                                </volist>
                              </div>
                            </div>
                        </div>
                    </volist>

                </div>
            <elseif condition="$_GET['recordclass'] eq 4"/>
            <!--手术史-->
            <div role="tabpanel" class="tab-pane" id="four">
                <volist name=":GetHealthRecordData($_GET['recordclass'],$info[patient]['id'])" id="v">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <div class="collapsed" data-toggle="collapse" data-parent="#accordion"
                                     aria-expanded="false" aria-controls="collapseTwo">
                                    <b>{$v[hospital]['title']}</b>
                                    <span style="float: right">{:date('Y-m-d',$v['create_time'])}</span>
                                </div>
                            </h4>
                        </div>
                        <div role="tabpanel">
                            <div role="tabpanel">
                                <div class="panel-body">
                                    {$v['content']}
                                </div>
                            </div>
                        </div>
                    </div>
                </volist>
            </div>
            <elseif condition="$_GET['recordclass'] eq 5"/>
            <!--过敏史-->
            <div role="tabpanel" class="tab-pane" id="five">
                <!--第一条-->
                <volist name=":GetHealthRecordData($_GET['recordclass'],$info[patient]['id'])" id="v">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <div class="collapsed" data-toggle="collapse" data-parent="#accordion"
                                 aria-expanded="false" aria-controls="collapseTwo">
                                <b>{$v[hospital]['title']}</b>
                                <span style="float: right">{:date('Y-m-d',$v['create_time'])}</span>
                            </div>
                        </h4>
                    </div>
                    <div role="tabpanel">
                        <div role="tabpanel">
                            <div class="panel-body">
                                {$v['content']}
                            </div>
                        </div>
                    </div>
                </div>
                </volist>
            </div>
        </if>
    <!--健康档案列表结束-->
    <!-- Modal -->

</div>
<div class="carrousel"><span class="close entypo-cancel" style="color: #FFFFFF;opacity: 1"></span>
    <div class="wrapper"><img src="images/" alt="BINGOO"/></div>
</div>
<!--主体结束-->
</div>
<!--尾部开始-->
<footer>
    <div class="footer_cont">
        <p>Copyright © 2008-2014 Change360.cn All Rights Reserved 西安创知信息科技有限公司</p>

        <p>地址：陕西省西安市高新区高新一路正信大厦A座204室</p>
    </div>
</footer>
<!--尾部结束-->
<script src="__HJS__jquery-2.1.1.js"></script>
<script src="__HJS__bootstrap.js"></script>
<script type="text/javascript" src="__HUI__lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__HUI__lib/layer/2.1/extend/layer.ext.js"></script>
<script type="text/javascript" src="__HJS__jquery.dataTables.min.js"> </script>
<script type="text/javascript">
tableSort($('.helper-list'));
function tableSort(obj) {
    var actionColumnIndex = $('.helper-name th').length;
    if (!actionColumnIndex || actionColumnIndex < 1) {
        return;
    }
    obj.dataTable({
        "aaSorting": [[1, "desc"]],
        "bStateSave": false,
        "aoColumnDefs": [
            {
                "orderable": false, "aTargets": [0, actionColumnIndex - 1]
            }
        ],
        "aLengthMenu": [[7], [7]],
        "sPaginationType": "full_numbers",
        "sDom": '<"top">rt<"bottom">p<"clear">'
//            "sDom": '<"top"fli>rt<"bottom">p<"clear">'
    });
}
  var selId="";
    function Byval(id,helper_id) {
         $('#patient_id').val(id);
        $('#alloc'+selId).html('分配');
        $('#alloc'+helper_id).html('已分配');
        $('#alloc'+helper_id).attr('onclick',null);
        selId = helper_id;
    }

    function allocation(helper_id) {
        //ajax提交分配助手
            var ajaxurl = "{:U('Index/allocation')}";
            var query = new Object();
            query.patient_id = $("#patient_id").val();
            query.helper_id = helper_id;	
            $.ajax({
                url:ajaxurl,
                data:query,
                type:"Post",
                dataType:"json",
                success:function(data){
                    if(data.status==1){
                     // alert(data['info']);
                        layer.alert(data['info']);
                       window.location.href = "{:U('Index/index')}";
                    } else {
                        layer.alert(data['info']);
                    }
                }
            });

    }
function check() {
    var frameSrc = "{:U('assay',array('patient_id'=>$info['patient_id']))}";
    $("#hylx").attr("src", frameSrc);
    $('#hylxModal').modal({show: true, backdrop: 'static'});
}
function chakan(id) {
    var frameSrc = "{:U('resulted')}"+"?id=" + id ;
    $("#chakan").attr("src", frameSrc);
    $('#chakanModal').modal({show: true, backdrop: 'static'});
}
$(document).on("click", ".text-right .btn-warning", function () {
    $("#two table tbody").prepend(''+
            '<tr style="line-height: 37px">'+
            '<td class="text-center">检测项目名</td>'+
            '<td class="set"  style="border-right: 1px solid #dddddd">'+
            '<a href="" onclick="check()" data-toggle="modal">请选择化验类型</a>' +
            '</td>'+
            '<td style="border-right: 1px solid #dddddd"></td><td class="jieguo"  style="border-right: 1px solid #dddddd"></td>'+
            '<td><a class="btn-xs btn-success" data-toggle="modal" href="javascript:;" onclick="chakan()">查看</a></td>' +
            '</tr>');

});
</script>
<script src="__HJS__common.js"></script>
<script src="__HJS__index.js"></script>
</body>
</html>